<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for in 循环</title>
    <script>
        var person = {id:1,name: "张三",age: 20};
        for(key in person) {
            document.write(key + ":" + person[key]);
            document.write('<br/>');
        }
    </script>
</head>
<body>
    
</body>
</html>